package com.qf.shopback.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //通过访问toUserList，可以直接获得user/userList页面，建立映射关系
        registry.addViewController("user/toUserList").setViewName("user/userList");
        registry.addViewController("user/toAddUser").setViewName("user/addUser");
        registry.addViewController("goods/toAddGoods").setViewName("goods/addGoods");
        registry.addViewController("goods/toGoodsList").setViewName("goods/goodsList");

    }
}
